package com.gwtintegration.smartrfsandbox.server.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gwtintegration.smartrf.server.DataRequest;
import com.gwtintegration.smartrfsandbox.server.data.UserDataResponse;
import com.gwtintegration.smartrfsandbox.server.entity.UserEntity;
import com.gwtintegration.smartrfsandbox.server.repository.UserRepository;

@Service
@Transactional
public class UserService {

	@Autowired
	private UserRepository userRepository;

	@Transactional(readOnly = true)
	public UserDataResponse fetch(DataRequest dataRequest) {
		return userRepository.fetch(dataRequest);
	}

	public UserEntity add(UserEntity entity) {
		return userRepository.add(entity);
	}

	public UserEntity update(UserEntity entity) {
		return userRepository.update(entity);
	}

	public void remove(UserEntity entity) {
		userRepository.remove(entity);
	}

}
